#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 1e5 + 10, p = 1e9 + 7;

LL n, a[N];

int main()
{
	cin >> n;
	LL d = 1e9;
	for(int i = 1;i <= n;i ++)
	{
		cin >> a[i];
		d = min(d, a[i]);
	}
	LL ans = 1;
	for(int i = 1;i <= n;i ++) ans = ans * (a[i] / d) % p;
	cout << d << " " << ans << endl;
	return 0;
}